package com.lovo.roomProject.room.service.impl;

import com.lovo.roomProject.pojo.CutPageBean;
import com.lovo.roomProject.pojo.FacilityDO;
import com.lovo.roomProject.pojo.RoomDO;
import com.lovo.roomProject.room.dao.RoomDAO;
import com.lovo.roomProject.room.dao.impl.RoomDAOImpl;
import com.lovo.roomProject.room.service.RoomService;

import java.util.List;

public class RoomServiceImpl implements RoomService {
    private RoomDAO roomDAO = new RoomDAOImpl();

    @Override
    public List listRoomByType(String type) {
        return roomDAO.listRoomByType(type);
    }

    @Override
    public List listRoom() {
        return roomDAO.listRoom();
    }

    @Override
    public void insert(RoomDO roomDO) {
        roomDAO.insert(roomDO);
    }

    @Override
    public void delete(int id) {
        roomDAO.delete(id);
    }

    @Override
    public RoomDO getById(int id) {
        return roomDAO.getById(id);
    }

    @Override
    public List getStudent(int id) {
        return roomDAO.getStudent(id);
    }

    @Override
    public CutPageBean listRoomByPage(int current,String addr,String status,String enableRoom,String roomType) {
        return roomDAO.listRoomByPage(current,addr,status,enableRoom,roomType);
    }

    @Override
    public List listFacility(int roomId) {
        return roomDAO.listFacility(roomId);
    }

    @Override
    public void insertFacility(FacilityDO facilityDO, int roomId) {
        roomDAO.insertFacility(facilityDO,roomId);
    }

    @Override
    public void updateFacility(int roomId) {
        roomDAO.updateFacility(roomId);
    }

    @Override
    public List updateRoomStatus(int roomId) {
        return  roomDAO.updateRoomStatus(roomId);
    }
}
